package com.yonyou.cyxdms.sysAuth.service.feign;

import com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse;
import com.yonyou.cyxdms.sysAuth.service.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * feign调用查询
 *
 * @author: rewnd
 * @since: 2018/11/21
 */

@FeignClient(value = "ops-file", configuration = MultipartSupportConfig.class)
public interface FileServiceClient {

    /**
     * @return String
     * @Description 单个文件上传
     * @author liyuquan
     * @since 2019/1/15 10:51
     */
    @PostMapping(value = "/oss/upload2", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public RestResultResponse<String> upload(@RequestPart("file") String file);

    /**
     * @return String
     * @Description byte[]单个文件上传
     * @author liyuquan
     * @since 2019/1/15 10:51
     */
    @PostMapping(value = "/oss/upload", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public RestResultResponse<String> upload(@RequestPart("file") MultipartFile file);

}
